package com.xnyzc.lhy.common.penum.work;

/**
 * @Description 工作时间类型
 * @Author zhuyubin
 * @Date 2019-08-19 18:06
 **/
public enum EWorkType {

    morningShift(0, "早班"),
    nightShift(1, "晚班");

    private Integer type;
    private String desc;

    EWorkType(Integer type, String desc){
        this.type = type;
        this.desc = desc;
    }

    public static EWorkType findById(Integer type) {
        EWorkType eWorkType;
        switch (type) {
            case 0:
                eWorkType = EWorkType.morningShift;
                break;
            case 1:
                eWorkType = EWorkType.nightShift;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eWorkType;
    }

    public Integer getType() {
        return this.type;
    }

    public String getDesc() {
        return this.desc;
    }
}
